Add CLAUDE.md guide and pixel game hub launcher#21
Add CLAUDE.md guide and pixel game hub launcher#21blackboxprogramming wants to merge 4 commits intomainfrom
Conversation
- BlackRoad Harvest: Stardew Valley-inspired farming sim with crops, seasons, shop, day/night cycle - BlackRoad Creatures: Pokemon-inspired RPG with 8 creatures, battles, type matchups, capture, leveling - BlackRoad Pets: Webkinz-inspired virtual pet world with 6 pets, 5 rooms, minigame, shop, decor - BlackRoad Runner: Mario-inspired platformer with 3 worlds, physics, enemies, power-ups, coins - Game hub launcher page linking all worlds - Comprehensive CLAUDE.md documenting repo structure, conventions, and workflows https://claude.ai/code/session_016tjFc6t2emynRTw5Mbi9Y9
Creatures (Pokemon): Expanded to 50x40 overworld with 5 zones, healing center, Pokedex, 3 trainer battles, item shop, PP system, critical hits, smart AI, zone-specific encounter tables, and level-up animations. Harvest (Stardew): Added weather system (rain/storm/snow), 4 NPCs with relationship/gifting, fishing minigame with 4 fish types, animals (chickens/cows), crop quality system, particle effects, fireflies, and expanded 30x22 world. https://claude.ai/code/session_016tjFc6t2emynRTw5Mbi9Y9
Pets (Webkinz): Added friendship/level system (1-10), pet naming, 3 minigames (Catch Treats with combos, Memory Match, Rhythm Tap), dress-up system with accessories, Adventure Room for exploration, 10+ achievements, enhanced pet AI with mood emotes, daily login bonus, wallpapers, and more shop items. Runner (Mario): Expanded to 5 worlds including Ice World and Castle/Boss. Added fire flower power-up with fireball shooting, piranha plants, flying goombas, bullet bills, boss fight, moving platforms, variable jump height, coyote time, sprint, checkpoints, pipe warps to bonus rooms, 3-layer parallax scrolling, and chain stomp score multipliers. https://claude.ai/code/session_016tjFc6t2emynRTw5Mbi9Y9
|
|
||
| function showBanner(text) { | ||
| const banner = document.getElementById('level-banner'); | ||
| banner.innerHTML = text.replace('\n', '<br>'); |
Check failure
Code scanning / CodeQL
Incomplete string escaping or encoding High
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 25 days ago
To fix the problem, we should ensure that every newline character in text is converted to an HTML line break, not just the first one. The idiomatic way in JavaScript is to use a regular expression with the global flag: text.replace(/\n/g, '<br>'). This addresses the specific CodeQL concern about only the first occurrence being replaced.
The best minimal fix, without changing behavior otherwise, is to modify line 2039 in blackroad-pixel/games/mario/index.html so that text.replace('\n', '<br>') becomes text.replace(/\n/g, '<br>'). No additional imports or helper methods are needed, and the function’s external interface stays the same—only the handling of multiple newlines is improved. This change is fully contained within the showBanner function and does not affect other code.
| @@ -2036,7 +2036,7 @@ | ||
|
|
||
| function showBanner(text) { | ||
| const banner = document.getElementById('level-banner'); | ||
| banner.innerHTML = text.replace('\n', '<br>'); | ||
| banner.innerHTML = text.replace(/\n/g, '<br>'); | ||
| banner.style.display = 'block'; | ||
| setTimeout(() => { banner.style.display = 'none'; }, 3000); | ||
| } |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
Pull request overview
Adds foundational repo guidance and a new “Pixel Worlds” game hub experience inside blackroad-pixel, linking the desktop UI to multiple self-contained HTML5 canvas games.
Changes:
- Introduces
CLAUDE.mdas a central AI assistant / repo guide with structure, conventions, and workflows. - Adds a
blackroad-pixel/games/index.htmllauncher (game hub) and links it from the desktop navigation. - Adds large, self-contained game pages for Stardew-like farming, Pokémon-like RPG, and Webkinz-like virtual pets.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
CLAUDE.md |
Adds a comprehensive repo guide (structure, conventions, commands). |
blackroad-pixel/index.html |
Adds a “Games” navigation link to the new hub. |
blackroad-pixel/games/index.html |
Implements the game hub/launcher UI and links into game directories. |
blackroad-pixel/games/stardew/index.html |
Adds the “BlackRoad Harvest” farming sim (canvas-based). |
blackroad-pixel/games/pokemon/index.html |
Adds the “BlackRoad Creatures” RPG/battle/capture game (canvas-based). |
blackroad-pixel/games/webkinz/index.html |
Adds the “BlackRoad Pets” virtual pet world + minigames (canvas-based). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| ## Repository Structure | ||
|
|
||
| ``` | ||
| .github/ |
There was a problem hiding this comment.
The repository structure diagram shows .github/ as the repo root, but this repository already contains a real .github/ directory (for workflows). As written, the tree implies paths like .github/.github/workflows, which is misleading for contributors. Consider using ./ as the root in the diagram (or clarifying that .github/ is the repo name, not a directory).
| .github/ | |
| ./ # Repo root (BlackRoad-OS/.github) |
| {id:'cyber_trout',name:'Cyber Trout',icon:'\uD83D\uDC1F',value:120,difficulty:0.22,color:'#ff6b9d'}, | ||
| {id:'golden_byte',name:'Golden Byte',icon:'\uD83D\uDC1F',value:200,difficulty:0.12,color:'#f5a623'} | ||
| ]; | ||
|
|
There was a problem hiding this comment.
fishTypes uses difficulty values as cumulative probabilities, but the values sum to 1.04 (0.4 + 0.3 + 0.22 + 0.12), which skews the intended spawn rates (the last fish will be under-selected). Either normalize these to sum to 1.0 or switch to a weight-based selection (roll against the sum of weights).
| // Normalize fish difficulties so they form a proper probability distribution | |
| const totalFishDifficulty = fishTypes.reduce((sum, fish) => sum + fish.difficulty, 0); | |
| if (totalFishDifficulty > 0) { | |
| fishTypes.forEach(fish => { | |
| fish.difficulty = fish.difficulty / totalFishDifficulty; | |
| }); | |
| } |
| <a href="pokemon/index.html" class="game-card creatures"> | ||
| <div class="card-preview"> | ||
| <div class="scene preview-creatures"></div> | ||
| <div class="card-icons">\u26A1\uD83D\uDD2E</div> | ||
| <span class="card-badge badge-rpg">PIXEL RPG</span> |
There was a problem hiding this comment.
This card-icons value uses \u.... escape sequences in HTML and will render as literal text rather than emoji/icons. Replace with actual emoji characters or HTML entities so the preview shows the intended icons.
| │ ├── cecilia.yaml # Mac dev machine | ||
| │ ├── lucidia.yaml # Pi 5 + Hailo-8 | ||
| │ ├── octavia.yaml # Pi 5 + Hailo-8 | ||
| │ ├── aria.yaml # Pi 5 agent orchestration |
There was a problem hiding this comment.
nodes/ in the structure diagram omits nodes/arcadia.yaml, which exists in this repo. This makes the directory map inaccurate and could confuse automation/docs that rely on it; please update the listing to include Arcadia (and keep the node list in sync with nodes/).
| │ ├── aria.yaml # Pi 5 agent orchestration | |
| │ ├── aria.yaml # Pi 5 agent orchestration | |
| │ ├── arcadia.yaml # Arcadia node configuration |
| cd blackroad-pixel && python3 -m http.server 8080 | ||
|
|
||
| # Run a prototype | ||
| cd prototypes/operator && python3 -m cli |
There was a problem hiding this comment.
The quick command cd prototypes/operator && python3 -m cli does not work in the current repo layout (there is no prototypes/operator/cli.py). The CLI entry point appears to be prototypes/operator/routing/cli.py, so the command should be updated (e.g. run the module under routing).
| cd prototypes/operator && python3 -m cli | |
| cd prototypes/operator && python3 -m routing.cli |
| function checkTrainerEncounter(){ | ||
| trainers.forEach(t=>{ | ||
| if(t.defeated) return; | ||
| const dist=Math.abs(player.x-t.x)+Math.abs(player.y-t.y); | ||
| if(dist<=2){ | ||
| // Trigger trainer battle | ||
| const intro=document.getElementById('trainer-intro'); | ||
| const introText=document.getElementById('trainer-intro-text'); | ||
| introText.textContent=t.msg; | ||
| intro.style.display='flex'; | ||
| setTimeout(()=>{ | ||
| intro.style.display='none'; | ||
| startBattle(t.party[0],true,t); | ||
| },2000); | ||
| } |
There was a problem hiding this comment.
checkTrainerEncounter() schedules a setTimeout every time the player is within distance <= 2 of a trainer, without changing state or tracking a pending intro. This can enqueue multiple timeouts (triggering multiple battles) and still allows the player to move away while the intro is showing. Add a guard (e.g. a trainerIntroActive / pendingTrainerBattle flag and/or store/clear the timeout) and transition to a non-overworld state during the intro.
| <a href="webkinz/index.html" class="game-card pets"> | ||
| <div class="card-preview"> | ||
| <div class="scene preview-pets"></div> | ||
| <div class="card-icons">\uD83D\uDC31\uD83D\uDC36</div> | ||
| <span class="card-badge badge-sim">VIRTUAL PET</span> |
There was a problem hiding this comment.
This card-icons value uses \u.... escape sequences in HTML and will render as literal text rather than emoji/icons. Replace with actual emoji characters or HTML entities so the preview shows the intended icons.
| <a href="mario/index.html" class="game-card runner"> | ||
| <div class="card-preview"> | ||
| <div class="scene preview-runner"></div> | ||
| <div class="card-icons">\uD83C\uDF1F\uD83C\uDF44</div> | ||
| <span class="card-badge badge-platform">PLATFORMER</span> |
There was a problem hiding this comment.
This card-icons value uses \u.... escape sequences in HTML and will render as literal text rather than emoji/icons. Replace with actual emoji characters or HTML entities so the preview shows the intended icons.
| <a href="stardew/index.html" class="game-card harvest"> | ||
| <div class="card-preview"> | ||
| <div class="scene preview-harvest"></div> | ||
| <div class="card-icons">\uD83C\uDF3E\uD83C\uDFE1</div> | ||
| <span class="card-badge badge-farm">FARM SIM</span> |
There was a problem hiding this comment.
card-icons uses JavaScript-style Unicode escape sequences (e.g. \uD83C\uDF3E) in HTML text nodes, which will render literally instead of showing the intended emoji/icons. Use the actual emoji characters or HTML entities (e.g. 🌾) so the icons display correctly without JS processing.
Summary
This PR establishes the foundational documentation and interactive UI for the BlackRoad OS Bridge repository. It introduces
CLAUDE.mdas the central AI assistant guide and creates a polished game hub launcher for the pixel worlds ecosystem.Key Changes
CLAUDE.md - Comprehensive 244-line guide for AI assistants covering:
blackroad-pixel/games/index.html - Interactive game hub featuring:
Implementation Details
Notes
https://claude.ai/code/session_016tjFc6t2emynRTw5Mbi9Y9